<?php

namespace App\model\customer;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * App\model\customer\Customer
 *
 * @property int $customer_id
 * @property string|null $address 地址
 * @property string|null $name 姓名
 * @property int|null $area_id 面积
 * @property int|null $hangye_id 行业
 * @property int|null $peidian_id
 * @property int|null $xuqiu 0 求购 1租
 * @property int|null $soure_id
 * @property int|null $ower_user_id
 * @property int|null $create_user_id
 * @property \Illuminate\Support\Carbon|null $deleted_at
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property string|null $desc
 * @property int|null $huanping_id 环评id
 * @property int|null $status 状态
 * @method static bool|null forceDelete()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\Customer newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\Customer newQuery()
 * @method static \Illuminate\Database\Query\Builder|\App\model\customer\Customer onlyTrashed()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\Customer query()
 * @method static bool|null restore()
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\Customer whereAddress($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\Customer whereAreaId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\Customer whereCreateUserId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\Customer whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\Customer whereCustomerId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\Customer whereDeletedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\Customer whereDesc($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\Customer whereHangyeId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\Customer whereHuanpingId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\Customer whereName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\Customer whereOwerUserId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\Customer wherePeidianId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\Customer whereSoureId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\Customer whereStatus($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\Customer whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\Customer whereXuqiu($value)
 * @method static \Illuminate\Database\Query\Builder|\App\model\customer\Customer withTrashed()
 * @method static \Illuminate\Database\Query\Builder|\App\model\customer\Customer withoutTrashed()
 * @mixin \Eloquent
 * @property string|null $telephone
 * @property int|null $xuqiu_id 0 求购 1租
 * @property int|null $source_id
 * @property int|null $wuye_id
 * @property int|null $xiaofang_id
 * @property string|null $code 编号
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\CustomerDetail whereCode($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\CustomerDetail whereSourceId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\CustomerDetail whereTelephone($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\CustomerDetail whereWuyeId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\CustomerDetail whereXiaofangId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\CustomerDetail whereXuqiuId($value)
 * @property string|null $area_format
 * @property string|null $hangye_format
 * @property string|null $peidian_format
 * @property string|null $xuqiu_format
 * @property string|null $source_format
 * @property string|null $huanping_format
 * @property string|null $wuye_format
 * @property string|null $xiaofang_format
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\CustomerDetail whereAreaFormat($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\CustomerDetail whereHangyeFormat($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\CustomerDetail whereHuanpingFormat($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\CustomerDetail wherePeidianFormat($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\CustomerDetail whereSourceFormat($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\CustomerDetail whereWuyeFormat($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\CustomerDetail whereXiaofangFormat($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\CustomerDetail whereXuqiuFormat($value)
 * @property int|null $department_id
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\CustomerDetail whereDepartmentId($value)
 * @property int|null $group_id
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\CustomerDetail whereGroupId($value)
 * @property int|null $big_part_id
 * @property string|null $create_user_name 创建人名称
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\CustomerDetail whereBigPartId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\CustomerDetail whereCreateUserName($value)
 * @property int|null $follow_status 跟进状态
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\CustomerDetail whereFollowStatus($value)
 * @property string|null $record_time 最后跟进时间
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\customer\CustomerDetail whereRecordTime($value)
 */
class CustomerDetail extends Model
{
    use SoftDeletes;
    protected $primaryKey='customer_id';
    protected $table='customer';
    public function getAreaIdAttribute($val){
        return  CustomerArea::find($val)->name ?? '';
    }
    public function getHangyeIdAttribute($val){
        return  CustomerHangye::find($val)->name ?? '';
    }
    public function getWuyeIdAttribute($val){
        return  CustomerWuye::find($val)->name ?? '';
    }
    public function getXuqiuIdAttribute($val){
        return  CustomerXuqiu::find($val)->name ?? '';
    }
    public function getPeidianIdAttribute($val){
        return  CustomerPeidian::find($val)->name ?? '';
    }
    public function getXiaofangIdAttribute($val){
        return  CustomerXiaofang::find($val)->name ?? '';
    }
    public function getHuanpingIdAttribute($val){
        return  CustomerHuanping::find($val)->name ?? '';
    }
    public function getSourceIdAttribute($val){
        return  CustomerSource::find($val)->name ?? '';
    }
}
